package com.xinqi.modules.prepare.prepare.client;

import com.xinqi.common.base.constants.ServiceNameConstants;
import com.xinqi.common.base.response.PageInfo;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.prepare.prepare.dto.req.PrepareCreateDTO;
import com.xinqi.modules.prepare.prepare.dto.req.PrepareQueryDTO;
import com.xinqi.modules.prepare.prepare.dto.req.PrepareUpdateDTO;
import com.xinqi.modules.prepare.prepare.dto.rsp.PrepareResultDTO;
import com.xinqi.modules.prepare.prepare.factory.PrepareFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 备课区客户端
 *
 * @author: wenjie
 * @date: 2023/10/30
 */
@FeignClient(value = ServiceNameConstants.XQ_PREPARE, fallbackFactory = PrepareFallbackFactory.class)
public interface PreparePrepareClient {

    /**
     * 备课区-分页
     */
    @GetMapping("/prepare/page")
    R<PageInfo<PrepareResultDTO>> page(PrepareQueryDTO dto);

    /**
     * 备课区-详情
     */
    @GetMapping("/prepare/{id}")
    R<PrepareResultDTO> findById(@PathVariable("id") Long id);

    /**
     * 新增备课区
     */
    @PostMapping("/prepare")
    R<Long> insert(@RequestBody PrepareCreateDTO dto);

    /**
     * 修改备课区
     */
    @PutMapping("/prepare/{id}")
    public R<Boolean> update(@PathVariable("id") Long id, @RequestBody PrepareUpdateDTO dto);

    /**
     * 删除备课区
     */
    @DeleteMapping("/prepare/{id}")
    R<Boolean> delete(@PathVariable("id") Long id);

}
